package com.zzt.questionbankusermanager.service.impl;

import com.zzt.questionbankusermanager.bean.User;
import com.zzt.questionbankusermanager.repository.UserRepository;
import com.zzt.questionbankusermanager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User findByUsername(String username) {
        return userRepository.findByUsername(username);
    }

    @Override
    public List<User> findAll(){
        return (List<User>) userRepository.findAll();
    }
}
